Repository navigation
fix(adapter-nextjs): don't enable browser source maps for Crashlytics until upload is supported - #714
Merged
abhis3 merged 1 commit intoNov 11, 2026
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Next.js adapter to ignore the CRASHLYTICS_UPLOAD_MAPPING environment variable and leave productionBrowserSourceMaps unchanged, logging a warning instead. This prevents the application's source maps from being served publicly from /_next/static since Crashlytics source-map upload is not yet supported on Cloud Run. The feedback suggests dynamically displaying the actual value of CRASHLYTICS_UPLOAD_MAPPING (e.g., '1' or 'true') in the warning message to avoid confusion, along with updating the corresponding test assertions.
abhis3
marked this pull request as ready for review
November 10, 2026 21:58
abhis3
requested review from
Yuangwang,
annajowang,
falahat and
leoortizz
as code owners
November 10, 2026 21:58
falahat
approved these changes
Nov 11, 2026
… until upload is supported With CRASHLYTICS_UPLOAD_MAPPING=true, modifyConfig set productionBrowserSourceMaps: true. Nothing on Cloud Run uploads those maps to Crashlytics or removes them from the image yet, so /_next/static/chunks/*.js.map was served publicly, with the full sourcesContent and an immutable one-year Cache-Control. modifyConfig now ignores CRASHLYTICS_UPLOAD_MAPPING, logs one warning that says why, and never changes productionBrowserSourceMaps, so a user's own setting is kept. A TODO marks where to turn it back on once source maps are uploaded and stripped during the build.
abhis3
force-pushed
the
fix/adapter-nextjs-no-public-sourcemaps
branch
from
November 11, 2026 18:51
80be421 to
6d4cdd6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Stacked on #713. Merge #713 first, then retarget this PR to
mainbefore merging. GitHub only retargets it automatically if #713's branch is deleted.Problem
With
CRASHLYTICS_UPLOAD_MAPPING=true, the adapter'smodifyConfigsetsproductionBrowserSourceMaps: true. Nothing on Cloud Run uploads those maps to Crashlytics or removes them from the image yet. SoGET /_next/static/chunks/*.js.mapreturns 200 with the fullsourcesContentandCache-Control: public, max-age=31536000, immutable, which publishes the app's client source.Change
modifyConfigno longer turns onproductionBrowserSourceMapsforCRASHLYTICS_UPLOAD_MAPPING. When the env var is set (trueor1), it logs one warning:[adapter-nextjs] Warning: Ignoring CRASHLYTICS_UPLOAD_MAPPING=true: Crashlytics source-map upload isn't available on Cloud Run yet, and enabling browser source maps would serve the app's source publicly. NextConfig productionBrowserSourceMaps is left unchanged.productionBrowserSourceMapssetting (trueorfalse) is never changed.CRASHLYTICS_UPLOAD_MAPPINGrow.productionBrowserSourceMapsstays unset when the env var istrueor1, and that the warning is logged once. It also checks that a user'strueorfalseis kept, with or without the env var, and that nothing is logged when the env var isn't set.Testing
npm testinpackages/@google-cloud/adapter-nextjs, on Node 18.20.8 and Node 22.23.4: 44 passing, 11 pending. The pending ones are theSMOKE_TEST=1suites, the same as on the base branch.npm run buildis clean on both.npm run lint:quietpasses, with no new warnings in the touched files.